package main

import "fmt"

func modify(a map[string]map[string]string) {
	_, ok := a["name"]
	if !ok {
		a["name"] = make(map[string]string)
	}
	a["name"]["Nick"] = "suoning"
	a["name"]["Nicky"] = "manyRou"
}

func testMap3() {
	var a map[string]map[string]string
	a = make(map[string]map[string]string, 10)    //初始化一维
	a["name"] = make(map[string]string)           //初始化二维

	modify(a)
	fmt.Println(a)  // map[name:map[Nick:suoning Nicky:manyRou]]
}

func main() {
	testMap3()
}
